package tr.gov.tubitak.bilgem.esya.crlviewer;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: ramazan.girgin
 * Date: 4/18/12
 * Time: 11:38 AM
 * To change this template use File | Settings | File Templates.
 */
public class EDateUtil {
    public static String date2String(Date date)
    {
        DateFormat dateFormat = DateFormat.getDateTimeInstance();
        return dateFormat.format(date);
    }
    public static Date string2Date(String dateStr)
    {
        DateFormat dateFormat = DateFormat.getDateTimeInstance();
        try {
            return dateFormat.parse(dateStr);
        } catch (ParseException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        return null;
    }
}
